package drds.global_transaction.global_transaction_manager.api;

import lombok.Getter;
import lombok.Setter;

public class GlobalTransactionExecutionException extends Exception
{
	private static final long serialVersionUID = 1L;
	@Setter
	@Getter
	private GlobalTransaction globalTransaction;
	@Setter
	@Getter
	private GlobalTransactionExecutionExceptionCode globalTransactionExecutionExceptionCode;
	@Setter
	@Getter
	private Throwable originalException;

	public GlobalTransactionExecutionException(GlobalTransaction globalTransaction, Throwable cause, GlobalTransactionExecutionExceptionCode globalTransactionExecutionExceptionCode)
	{
		this(globalTransaction, cause, globalTransactionExecutionExceptionCode, null);
	}

	public GlobalTransactionExecutionException(GlobalTransaction globalTransaction, GlobalTransactionExecutionExceptionCode globalTransactionExecutionExceptionCode, Throwable originalException)
	{
		this(globalTransaction, null, globalTransactionExecutionExceptionCode, originalException);
	}

	public GlobalTransactionExecutionException(GlobalTransaction globalTransaction, Throwable cause, GlobalTransactionExecutionExceptionCode globalTransactionExecutionExceptionCode, Throwable originalException)
	{
		this(globalTransaction, null, cause, globalTransactionExecutionExceptionCode, originalException);
	}

	public GlobalTransactionExecutionException(GlobalTransaction globalTransaction, String message, Throwable cause, GlobalTransactionExecutionExceptionCode globalTransactionExecutionExceptionCode, Throwable originalException)
	{
		super(message, cause);
		this.globalTransaction = globalTransaction;
		this.globalTransactionExecutionExceptionCode = globalTransactionExecutionExceptionCode;
		this.originalException = originalException;
	}
}
